#!/usr/bin/python3
# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: t -*-

import abc


class UpLinkBase(abc.ABC):

    class Callback(abc.ABC):

        @abc.abstractmethod
        def on_uplink_activated(self, uplink_livedata):
            pass

        @abc.abstractmethod
        def on_uplink_deactivated(self, reason):
            pass

        @abc.abstractmethod
        def on_uplink_rechecking(self):
            # we think this uplink is usable, but we need to be sure
            pass

        @abc.abstractmethod
        def on_uplink_recheck_completed(self):
            pass

    def __init__(self, plugin):
        self._plugin = plugin
        self._callback = None

    def set_callback(self, obj):
        assert self._callback is None
        assert isinstance(obj, self.Callback)
        self._callback = obj

    def get_plugin(self):
        return self._plugin

    @abc.abstractmethod
    def get_uuid(self):
        pass

    @abc.abstractmethod
    def get_name(self):
        pass

    @abc.abstractmethod
    def get_description(self):
        pass

    @abc.abstractmethod
    def get_dependencies(self):
        pass

    @abc.abstractmethod
    def is_auto_connect(self):
        pass

    @abc.abstractmethod
    def activate(self, stage_id, stage_data):
        pass

    @abc.abstractmethod
    def deactivate(self, stage_id, stage_data):
        pass
